﻿using CommonServiceLocator;
using Prism.Events;
using Prism.Services.Dialogs;

namespace System
{
    /// <summary>
    /// 全局对象类
    /// </summary>
    public class GlobalManager
    {
        private static IEventAggregator _eventAggregator;
        /// <summary>
        /// 事件发布/订阅对象
        /// </summary>
        public static IEventAggregator EventAggregator => _eventAggregator ?? (_eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>());

        #region 接口

        private static Log4NetLogger _Logger;
        /// <summary>
        /// 日志
        /// </summary>
        public static Log4NetLogger Logger => _Logger ?? (_Logger = new Log4NetLogger());

        private static IDialogService _DialogService;
        /// <summary>
        /// 弹窗
        /// </summary>
        public static IDialogService DialogService => _DialogService ?? (_DialogService = ServiceLocator.Current.GetInstance<IDialogService>());
        #endregion

    }
}
